<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center zixun_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub zixun_fd0_0'>
					<view class='flex flex-wrap align-center zixun_fd0_0_c0'>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='zixun_fd0_0_c1_c0'>资讯</text>
					</view>
					<view class='flex flex-wrap align-center justify-end zixun_fd0_0_c0'>
					</view>
				</view>
			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction align-stretch benben-flex-layout zixun_flex_1">
				<view>
					<benben-flex-tabs class-name='zixun_benbenTabsfd1_0' v-model="tabsTypefd1_0" ref="benben_tabsfd1_0"
						select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false'
						:open-sticky='true' :top='0' :is-show-content='false' :scrollspy='false'
						:tabs-info.sync="tabsInfofd1_0" @change="newschange">

						<scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
							class="benben-tabs" style="width:750rpx" :scroll-x="true"
							:scroll-left.sync="tabsInfofd1_0.moveX" scroll-with-animation="all .3s ease">
							<view class="benben-tabs-content" id="benben_tabsfd1_0-content">
								<view id="benben_tabsfd1_0-title"
									class="benben-tabs-title flex flex align-center justify-around">
									<view
										:class="{ 'checkTitlefd1_0': tabsTypefd1_0 == '1', 'flex flex-wrap align-center': true }"
										@tap="tabsTypefd1_0 = '1'" :id="`benben_tabsfd1_0-title-item-${'1'}`">

										<text>文章</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabsTypefd1_0 == '2', 'flex flex-wrap align-center': true }"
										@tap="tabsTypefd1_0 = '2'" :id="`benben_tabsfd1_0-title-item-${'2'}`" v-if="web_site_status==1">

										<text>视频</text>

									</view>
									<view
										:class="{ 'checkTitlefd1_0': tabsTypefd1_0 == '3', 'flex flex-wrap align-center': true }"
										@tap="tabsTypefd1_0 = '3'" :id="`benben_tabsfd1_0-title-item-${'3'}`">

										<text>公告</text>

									</view>
								</view>
								<view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
									id="benben_tabsfd1_0-line"
									class="benben-tabs-line flex benben-flex-tabs-line zixun_linefd1_0"></view>
							</view>
						</scroll-view>

					</benben-flex-tabs>

				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex benben-flex-layout flex-wrap align-center" v-if="tabsTypefd1_0==1">
				<template v-for='(item,key0) in wezzhanglist'>
					<view class='flex flex-direction flex-wrap align-stretch zixun_fd2_0' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/zixun/wenzhangdetail/wenzhangdetail?aid=${item.aid}`"
						:key='key0'>
						<text class='zixun_fd2_0_c0'>{{item.title}}</text>
						<view class='flex flex-wrap align-center zixun_fd2_0_c1'>
							<template v-for='(child,key1) in item.img_url'>
								<view class='flex flex-wrap align-center zixun_fd2_0_c1_c0' :key='key1'>
									<image class='zixun_fd2_0_c1_c0_c0' mode="aspectFill" :src='child'>
									</image>
								</view>
							</template>

						</view>
						<view class='flex flex-wrap align-center justify-between zixun_fd2_0_c2'>
							<!-- <view class='flex flex-wrap align-center justify-center zixun_fd2_0_c2_c0'
								@click.stop="shareclick(item)">
								<image class='zixun_fd2_0_c2_c0_c0' mode="aspectFit" :src='STATIC_URL+"46.png"'></image>
								<text class='zixun_fd2_0_c2_c0_c1'>转发</text>
							</view> -->
							<button open-type="share" class='flex flex-wrap align-center justify-center zixun_fd2_0_c2_c0'@click.stop="shareclick(item)">
								<image class='zixun_fd2_0_c2_c0_c0' mode="aspectFit" src='https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/46.png'></image>
								<text class='zixun_fd2_0_c2_c0_c1'>转发</text>
							</button>
							<view class='flex flex-wrap align-center'>
								<text class='zixun_fd2_0_c2_c1_c0'>{{item.create_time}}</text>
							</view>
						</view>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<!-- 视频信息 -->
			<view class="flex flex-direction align-stretch benben-flex-layout" v-if="tabsTypefd1_0==2">
				<view class=''>
					<view class='flex flex-wrap align-center justify-around zixun_fd3_0_c0'
						@tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/zixun/shipindetail/shipindetail?aid=${item.aid}`" v-for='(item,key0) in wezzhanglist' :key='key0'>
						<image class='zixun_fd3_0_c0_c0' mode="aspectFill" :src='item.video.thumb'></image>
						<view class='flex flex-wrap align-center zixun_fd3_0_c0_c1'>
							<text class='zixun_fd3_0_c0_c1_c0'>{{item.title}}</text>
							<view class='flex flex-wrap align-center justify-between zixun_fd3_0_c0_c1_c1'>
								<!-- <view class='flex flex-wrap align-center' @click.stop="shareclick(item)">
									<image class='zixun_fd3_0_c0_c1_c1_c0_c0' mode="aspectFit"
										:src='STATIC_URL+"46.png"'></image>
									<text class='zixun_fd3_0_c0_c1_c1_c0_c1'>转发</text>
								</view> -->
								<!-- <button open-type="share" class='flex flex-wrap align-center' @click.stop="shareclick(item)">
									<image class='zixun_fd3_0_c0_c1_c1_c0_c0' mode="aspectFit" src='https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/46.png'></image>
									<text class='zixun_fd3_0_c0_c1_c1_c0_c1'>转发</text>
								</button> -->
								<button open-type="share" class='flex flex-wrap align-center justify-center zixun_fd2_0_c2_c0' style="margin-top: 10rpx;" @click.stop="shareclick(item)">
									<image class='zixun_fd2_0_c2_c0_c0' mode="aspectFit" src='https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/46.png'></image>
									<text class='zixun_fd2_0_c2_c0_c1'>转发</text>
								</button>
								<view class='flex flex-wrap align-center justify-between zixun_fd3_0_c0_c1_c1_c1'>
									<text class='zixun_fd3_0_c0_c1_c1_c1_c0'>{{item.create_time}}</text>
								</view>
							</view>
						</view>
					</view>
				</view>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>
			<!-- 公告信息 -->
			<view class="flex flex-direction align-stretch benben-flex-layout" v-if="tabsTypefd1_0==3">
				<template v-for='(item,key0) in getNoticeList'>
					<view class='flex flex-wrap align-center justify-center zixun_fd3_1' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/zixun/gonggaodetail/gonggaodetail?aid=${item.aid}`"
						:key='key0'>
						<view class='flex flex-wrap align-center justify-between zixun_fd3_1_c0'>
							<view class='flex flex-wrap align-center zixun_fd3_1_c0_c0'>
								<text class='zixun_fd3_1_c0_c0_c0'>{{item.title}}</text>
							</view>
							<view class='flex flex-wrap align-center zixun_fd3_1_c0_c1'>
								<text class='zixun_fd3_0_c0_c1_c1_c1_c0'>{{item.create_time_text}}</text>
							</view>
						</view>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>
			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"tabsInfofd1_0": {
					lineleft: '',
					lineWidth: '',
					moveX: 0,
					scrollX: 0,
					PageScrollX: 0
				},
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"tabsTypefd1_0": "1",
				"page": "1",
				"list_rows": 15,
				"wezzhanglist": [], //文章列表
				"operationarticlecate_id": "19", //区别文章和视频
				"getNoticeList": [], //公告列表

				share: {
					title: '',
					path: '', // 全局分享的路径
					imageUrl: '', // 全局分享的图片(可本地可网络)
				}, //分享
				web_site_status:"0",//上架信息

			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.get_operationarticle_listFunc()
			this.get_config();//获取配置信息

		},
		// 1.发送给朋友
		onShareAppMessage(res) {
			return {
				title: this.share.title,
				path: this.share.path,
				imageUrl: this.share.imageUrl,
			}
		},
		//2.分享到朋友圈
		onShareTimeline(res) {
			return {
				title: this.share.title,
				path: this.share.path,
				imageUrl: this.share.imageUrl,
			}
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.get_operationarticle_listFunc()
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取配置信息
			get_config(){
				this.$api.post(global.apiUrls.get_config, {
				}).then(res => {
					if (res.data.code == 1) {
						this.web_site_status = res.data.data.web_site_status;
					}
				})
			},
			
			//获取文章列表
			get_operationarticle_listFunc() {
				this.minixPagingListsApi = global.apiUrls.post65bf460d9166f;
				this.pageingListApiMethod = 'post';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {
					operationarticlecate_id: this.operationarticlecate_id
				}
				this.listData = [];
				this.wezzhanglist = this.listData;
				this.pagingListToggle();

			},

			//获取公告列表
			getNoticeListFunc() {
				this.minixPagingListsApi = global.apiUrls.post6415752f56d0f;
				this.pageingListApiMethod = 'get';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {
					category_id: '1'
				}
				this.listData = [];
				this.getNoticeList = this.listData;
				this.pagingListToggle();

			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			},

			//tabs切换
			newschange() {
				if (this.tabsTypefd1_0 == 1) {
					this.operationarticlecate_id = 19;
					this.get_operationarticle_listFunc();
				} else if (this.tabsTypefd1_0 == 2) {
					this.operationarticlecate_id = 20;
					this.get_operationarticle_listFunc();
				} else {
					this.getNoticeListFunc()
				}
			},

			//分享事件
			shareclick(item) {
				let _this = this;
				if(this.tabsTypefd1_0==1){
					_this.share.title = item.title;
					_this.share.path = "/pages/zixun/wenzhangdetail/wenzhangdetail?aid=" + item.aid;
					_this.share.imageUrl = item.img_url[0];
				}else if(this.tabsTypefd1_0==2){
					_this.share.title = item.title;
					_this.share.path = "/pages/zixun/shipindetail/shipindetail?aid=" + item.aid;
					_this.share.imageUrl = item.video.thumb;
				}
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #EFEFEF;
		background-size: 100% auto;
	}

	.zixun_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.zixun_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 700;
		line-height: 50rpx;
		color: rgba(26, 26, 26, 1);
	}

	.zixun_fd0_0_c0 {
		width: 120rpx;
	}

	.zixun_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.zixun_flex_1 {
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.zixun_linefd1_0 {
		background: rgba(38, 191, 1, 1);
		width: 50rpx;
		height: 8rpx;
		top: 80rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx;
	}

	.checkTitlefd1_0 {
		font-weight: 700 !important;
		font-size: 32rpx !important;
		color: #26BF01 !important;
		background-color: rgba(255, 255, 255, 1) !important;
	}

	::v-deep .zixun_benbenTabsfd1_0 {
		background: rgba(255, 255, 255, 1);
		width: 750rpx;
		height: 90rpx;
		white-space: nowrap;
		text-align: center;
		font-size: 32rpx;
	}

	.zixun_fd2_0_c2_c1_c0 {
		font-size: 28rpx;
		color: rgba(51, 51, 51, 1);
		margin: 0rpx 0rpx 24rpx 9rpx;
	}

	.zixun_fd2_0_c2_c0_c1 {
		font-size: 28rpx;
		margin: 0rpx 0rpx 0rpx 8rpx;
	}

	.zixun_fd2_0_c2_c0_c0 {
		width: 24rpx;
		height: 28rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.zixun_fd2_0_c2_c0 {
		width: 120rpx;
		height: 50rpx;
		line-height: 50rpx;
		padding: 0rpx 0rpx 48rpx 0rpx;
	}

	.zixun_fd2_0_c2 {
		margin: 30rpx 29rpx 0rpx 0rpx;
	}

	.zixun_fd2_0_c1_c0_c0 {
		width: 217rpx;
		height: 217rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.zixun_fd2_0_c1_c0 {
		width: 217rpx;
		height: 217rpx;
		margin-right: 20rpx;
	}
	.zixun_fd2_0_c1_c0:nth-child(3n){
		margin-right: 0;
	}

	.zixun_fd2_0_c1 {
		margin: 30rpx 0rpx 0rpx 0rpx;
		width: 700rpx;
	}

	.zixun_fd2_0_c0 {
		color: rgba(51, 51, 51, 1);
		font-weight: 500;
		line-height: 42rpx;
		-webkit-line-clamp: 2;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		margin: 0rpx 29rpx 0rpx 0rpx;
		font-size: 28rpx;
		width: 700rpx;
	}

	.zixun_fd2_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 29rpx 0rpx 0rpx 30rpx;
		background-size: 100% auto !important;
		margin: 0rpx 0rpx 20rpx 0rpx;
		width: 100%;
	}

	.zixun_fd3_1_c0_c1 {
		width: 170rpx;
		height: 100%;
		margin: 0rpx 24rpx 0rpx 0rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.zixun_fd3_1_c0_c0_c0 {
		font-size: 28rpx;
		color: rgba(51, 51, 51, 1);
		margin: 0rpx 0rpx 0rpx 24rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.zixun_fd3_1_c0_c0 {
		width: 480rpx;
		line-height: 100rpx;
		height: 100rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.zixun_fd3_1_c0 {
		border: 1px solid #eee;
		height: 100rpx;
		line-height: 100rpx;
		width: 100%;
	}

	.zixun_fd3_1 {
		background: #fff;
		width: 750rpx;
		background-size: 100% auto;
	}

	.zixun_fd3_0_c0_c1_c1_c1_c0 {
		font-size: 28rpx;
		color: rgba(51, 51, 51, 1);
	}

	.zixun_fd3_0_c0_c1_c1_c1 {
		font-size: 28rpx;
	}

	.zixun_fd3_0_c0_c1_c1_c0_c1 {
		font-size: 28rpx;
		color: rgba(51, 51, 51, 1);
		font-weight: 400;
		margin: 4rpx 0rpx 0rpx 10rpx;
		padding: 8rpx 0rpx 0rpx 0rpx;
	}

	.zixun_fd3_0_c0_c1_c1_c0_c0 {
		width: 24rpx;
		height: 28rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 8rpx 0rpx 0rpx 0rpx;
	}

	.zixun_fd3_0_c0_c1_c1 {
		width: 316rpx;
	}

	.zixun_fd3_0_c0_c1_c0 {
		font-size: 24rpx;
		color: rgba(51, 51, 51, 1);
		text-decoration: none;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.zixun_fd3_0_c0_c1 {
		width: 316rpx;
		font-style: normal;
	}

	.zixun_fd3_0_c0_c0 {
		width: 316rpx;
		height: 316rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		margin: 10rpx 0rpx 24rpx 0rpx;
	}

	.zixun_fd3_0_c0 {
		background: #fff;
		border-radius: 16rpx;
		padding: 0rpx 0rpx 22rpx 0rpx;
		margin: 20rpx 0rpx 20rpx 0rpx;
		width: 336rpx;
		height: 490rpx;
		float: left;
		margin-left: 30rpx;
	}
</style>